package com.guestbook.imp;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.entity.Guestbook;
import com.guestbook.biz.GuestbookBiz;
import com.guestbook.dao.GuestbookDao;
@Service("guestbookBiz")
public class GuestbookBizImp implements GuestbookBiz
{
    @Autowired
    private GuestbookDao guestbookDao;

    public Guestbook findById(Integer id)
    {
        return guestbookDao.findById(id);
    }

    public List<Guestbook> findAll()
    {
        return guestbookDao.findAll();
    }

    public Guestbook save(Guestbook entity)
    {
        entity.setCreatedtime(new Date());
        guestbookDao.save(entity);
        return entity;
    }

    public Guestbook update(Guestbook entity)
    {
        guestbookDao.update(entity);
        return null;
    }

    public void deleteById(Integer id)
    {
        guestbookDao.deleteById(id);
    }

    public List<Guestbook> findAllOrderById()
    {
        return guestbookDao.findAllOrderById();
    }

    public List<Guestbook> findByPage(int page)
    {
        return guestbookDao.findByPage(page);
    }

    
   

}
